package cn.zn.modules.money.cur.entity;

import cn.zn.framework.common.abs.AbsOldMainEntity;
import cn.zn.modules.money.enums.MoneyTypeEnum;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "t_money_info_detail")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class TMoneyInfoDetail extends AbsOldMainEntity {

    /**
     * 经济分类
     */
    @TableField(value = "CATE_CODE_")
    private String cateCode;

    /**
     * 金额
     */
    @TableField(value = "MONEY_")
    private Double money;

    /**
     * 经费类型
     */
    @TableField(value = "MONEY_TYPE_CODE_")
    private String moneyTypeCode;

    /**
     * 项目
     */
    @TableField(value = "PROJECT_CODE_")
    private String projectCode;

    /**
     * 状态
     */
    @TableField(value = "STATE_")
    @Builder.Default
    private Integer state = 0;

    /**
     * 来源
     */
    @TableField(value = "SOURCE_")
    private String source;

    /**
     * 来源标识
     */
    @TableField(value = "SOURCE_TAG_")
    private String sourceTag;

    /**
     * 项目名称
     */
    @TableField(exist = false)
    private String projectName;

    /**
     * 经济分类名称
     */
    @TableField(exist = false)
    private String cateName;

    public String getMoneyTypeName(){
        return MoneyTypeEnum.findByCode(this.getMoneyTypeCode()).getName();
    }

    /**
     * 查询条件
     */
    @TableField(exist = false)
    private String key;
    /**
     * 查询状态
     */
    @TableField(exist = false)
    private String queryState;
}